Executing OS commands from PL? [message #35967] |
Fri, 26 October 2001 04:41 |
patrick
Messages: 83 Registered: December 2000
|
Member |
|
|
From SQL*plus I can execute "$dir c:*.* > files.txt".
Is it possible to do this within a stored procedure?
----------------------------------------------------------------------
|
|
|
|
Re: Executing OS commands from PL? [message #35975 is a reply to message #35967] |
Sat, 27 October 2001 07:27 |
Milan Kumar Barui
Messages: 16 Registered: October 2001
|
Junior Member |
|
|
For executing OS command from PL/SQL,
Step 1: Write pl/sql program what sends commands to oracle shared memory by using DBMS_PIPE.PACK_MESSAGE('command') and DBMS_PIPE.SEND_MESSAGE('pipe').
step 2: write one pro*c program which recieves this command by
DBMS_PIPE.RECIEVE_MESSAGE('pipe') and DBMS_PIPE.UNPACK_MESSAGE('command').
write execute(command) in this program.
STEP 3: compile pro*c program and run in back end as detached process in loop.
step 4: run pl/sql and send message to pro*c and it will execute.
Just try, it must work. Give me feedback.
Milan
----------------------------------------------------------------------
|
|
|